﻿namespace DesignPattern.com.singleton {
    /// <summary>
    /// 单例模式
    /// </summary>
    public class SingletonDemo {

        public string a="single";
        
        private SingletonDemo(){ }
        private static SingletonDemo _instance;

        public static SingletonDemo Instance {
            get {
                if (_instance == null){
                    _instance=new SingletonDemo();
                }
                return _instance;
            }
        }
    }
}